Skip to main content

Reverse Chaining

note

Generated by ChatGPT, leaving it here for my own reference

Scenario

Imagine an expert system designed to diagnose issues with a home heating system.

Goal (Hypothesis)

The heating system is not working.

Rules

  • Rule 1: If the thermostat is set incorrectly, the heating system will not work.
  • Rule 2: If the power supply is disrupted, the heating system will not work.
  • Rule 3: If the furnace is malfunctioning, the heating system will not work.

Backward Chaining Process

  • Start with the Goal: The goal is to find out why the heating system is not working.
  • Examine Rules Leading to the Goal: Look at the rules that could result in the heating system not working:
    • Is the thermostat set incorrectly?
    • Is the power supply disrupted?
    • Is the furnace malfunctioning?

Check Facts for Each Rule:

  • For Rule 1, check if the thermostat is set correctly.
  • For Rule 2, check if there's a power outage or if the system's breaker has tripped.
  • For Rule 3, inspect the furnace for any signs of malfunction.

Determine Which Facts are True

  • Suppose you find the thermostat is set correctly (this rules out Rule 1).
  • There's no power outage, and the breaker is fine (this rules out Rule 2).
  • On inspecting the furnace, you discover it's not igniting properly (indicating a malfunction).

Conclude Based on Facts

Since the furnace is malfunctioning (supported by Rule 3), you conclude this is the cause of the heating system not working.

Diagram Representation

[Goal: Heating System Not Working]
|
|____ [Check Rule 3: Furnace Malfunction -> Heating System Not Working]
| |
| [Furnace is Malfunctioning]
|
|____ [Check Rule 2: Power Disruption -> Heating System Not Working]
| |
| [Power Supply is Fine]
|
|____ [Check Rule 1: Thermostat Setting -> Heating System Not Working]
|
[Thermostat is Set Correctly]

Summary

In this backward chaining example, we started with a hypothesis (the heating system is not working) and worked our way through the rules to find supporting facts. By checking each rule in reverse and examining the relevant facts, we were able to identify the cause of the problem. Backward chaining is especially useful in situations where the number of potential causes is large, and the goal is to narrow down the possibilities efficiently.